Page({
 data:{
  houseDetail: {},
 },
 onLoad({id}){
this.getHouseDetail(id)
wx.setNavigationBarTitle({
  title:id ? '修改房屋':"增加房五"
})
 },
async getHouseDetail(id){
if(!id) return wx.utils.toast('参数有误')
const {data:houseDetail,code}=await wx.http.get('/room/'+id)
if(code!==10000)return wx.utils.toast()
this.setData({
  houseDetail
})
 },

  editHouse(ev) {
    console.log(ev.mark.id);
    wx.navigateTo({
      url: '/house_pkg/pages/form/index?id='+this.data.houseDetail.id,
    })
  },
})
